#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <climits>
#define int long long
#define x first 
#define y second 
using namespace std;
void solve()
{
    int n;
    cin >> n;
    string s;
    cin >> s;
    string t;
    cin >> t;
    string tar;
    cin >> tar;
    for(int i = 0; i < n; i++)
    {
        if(s[i] == tar[i] || t[i] == tar[i]) continue;
        cout << "No" << endl;
        return;
    }
    cout << "Yes" << endl;
}
signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr),cout.tie(nullptr);
    int t = 1;
    while(t -- ) solve();
    return 0;
}